package com.zjdiepu.www.commpent.mapper.base;

import javax.annotation.Resource;

import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.stereotype.Component;

import com.zjdiepu.www.base.core.BaseMapper;
import com.zjdiepu.www.base.enums.type.DataDicType;
import com.zjdiepu.www.commpent.RedisObjectClient;
import com.zjdiepu.www.model.base.dto.DpBaseContractVersion;
import com.zjdiepu.www.model.base.dto.SimpleDataDictionary;
/**
 * 项目名称：diepu-parent-biz <br/> 
 * 类名称：DpBaseContractVersionVoMapper <br/>  
 * 类描述：银行合同版本 <br/>    
 * 创建人：xiongxiaotun <br/> 
 * 创建时间：2017年4月26日 下午1:33:37  <br/>   
 * 修改人：xiongxiaotun <br/> 
 * 修改时间：2017年4月26日 下午1:33:37   <br/>  
 * 修改备注：    <br/> 
 * @version V1.0   <br/>
 */
@Component
public class DpBaseContractVersionVoMapper extends BaseMapper<DpBaseContractVersion>{
	@Resource
	private RedisObjectClient redisObjectClient;

	@Override
	public void mapper(RedisConnection redisConnection, DpBaseContractVersion m) {
		if(null == m) {
			return;
		}
		String dataDictionaryValue = m.getDataDictionaryValue();
		SimpleDataDictionary simpleDataDictionary1 = redisObjectClient.hGet(redisConnection, SimpleDataDictionary.class.getSimpleName(), dataDictionaryValue, DataDicType.BANK.getCode());
		m.setDataDictionaryValueDisplay(simpleDataDictionary1 == null ? "" : simpleDataDictionary1.getName());
	}

}
